    /*
    * component:ajax
    * author:zhoujj
    * date:2014-09-01
    * */
    Tesla.fn.ajaxJSON = function(service, type, param) {
        var _def = $.Deferred();

        $.ajax({
            url : this.getServicePath(service),
            data : type.toUpperCase() === "GET" ?  param : JSON.stringify(param),
            dataType : "json",
            type : type,
            contentType : "application/json;charset=UTF-8",
            success : function(result) {
                if (result.returnCode.code === "AAAAAA") {
                	emit($ts.REQUEST_SUCCESS, result);
                    _def.resolve(result.reply);
                } else {
                	emit($ts.REQUEST_FAILED, result);
                    _def.reject(result);
                }
            },
            error : function(result) {
            	emit($ts.REQUEST_FAILED, result);
                _def.reject(result);
            },
            cache :false
        });
        return _def.promise();
    };

    Tesla.fn.postJSON = function(service,param){
        return this.ajaxJSON(service,"POST",param);
    };

    Tesla.fn.getJSON = function(service,param){
    	return this.ajaxJSON(service,"GET",param);
    };

    Tesla.fn.getJSON = function(service,param){
    	return this.ajaxJSON(service,"PUT",param);
    };

    Tesla.fn.getJSON = function(service,param){
    	return this.ajaxJSON(service,"DELETE",param);
    };
